home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2004 April / Gamestar_61_2004-04_dvdb.iso / DVDStar / Editace / hltp.exe / {app} / Source Code / Textures SDK / common / wadlib.h < prev   
C/C++ Source or Header  |  1998-12-02  |  1KB  |  64 lines

  1. /***
  2. *
  3. *    Copyright (c) 1998, Valve LLC. All rights reserved.
  4. *    
  5. *    This product contains software technology licensed from Id 
  6. *    Software, Inc. ("Id Technology").  Id Technology (c) 1996 Id Software, Inc. 
  7. *    All Rights Reserved.
  8. *
  9. ****/
  10.  
  11. // wadlib.h
  12.  
  13. //
  14. // wad reading
  15. //
  16.  
  17. #define    CMP_NONE        0
  18. #define    CMP_LZSS        1
  19.  
  20. #define    TYP_NONE        0
  21. #define    TYP_LABEL        1
  22. #define    TYP_LUMPY        64                // 64 + grab command number
  23.  
  24. typedef struct
  25. {
  26.     char        identification[4];        // should be WAD2 or 2DAW
  27.     int            numlumps;
  28.     int            infotableofs;
  29. } wadinfo_t;
  30.  
  31.  
  32. typedef struct
  33. {
  34.     int            filepos;
  35.     int            disksize;
  36.     int            size;                    // uncompressed
  37.     char        type;
  38.     char        compression;
  39.     char        pad1, pad2;
  40.     char        name[16];                // must be null terminated
  41. } lumpinfo_t;
  42.  
  43. extern    lumpinfo_t        *lumpinfo;        // location of each lump on disk
  44. extern    int                numlumps;
  45. extern    wadinfo_t        header;
  46.  
  47. void    W_OpenWad (char *filename);
  48. int        W_CheckNumForName (char *name);
  49. int        W_GetNumForName (char *name);
  50. int        W_LumpLength (int lump);
  51. void    W_ReadLumpNum (int lump, void *dest);
  52. void    *W_LoadLumpNum (int lump);
  53. void    *W_LoadLumpName (char *name);
  54.  
  55. void CleanupName (char *in, char *out);
  56.  
  57. //
  58. // wad creation
  59. //
  60. void    NewWad (char *pathname, qboolean bigendien);
  61. void    AddLump (char *name, void *buffer, int length, int type, int compress);
  62. void    WriteWad (int wad3);
  63.  
  64.